<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Transactietest</TITLE>
</HEAD>

<BODY>
<?php

include "transactions.php";

$db = mysql_connect("localhost", "leerphp", "bla!vux6")
        or die("Kan niet verbinden: " . mysql_error());
mysql_select_db("leerphp", $db);

mysql_start_transaction();

$sql = "INSERT INTO testtabel (id,veld1,veld2) 
VALUES (
'', 'arjan', 'burger'
), (
'', 'leer professioneel', 'php'
);";

$result = mysql_query($sql) or die("Kan query niet uitvoeren: " . mysql_error());

if (mysql_affected_rows($db) == 2) {

	echo "Transaction is geslaagd";
	mysql_commit();

} else {

	echo "problem in transaction";
	mysql_rollback();

}

?>
</BODY>
</HTML>
